package com.nbsaas.boot.shop.rest.resource;

import com.nbsaas.boot.shop.api.apis.ShopAppApi;
import com.nbsaas.boot.shop.data.entity.ShopApp;
import com.nbsaas.boot.shop.api.domain.request.ShopAppRequest;
import com.nbsaas.boot.shop.api.domain.response.ShopAppResponse;
import com.nbsaas.boot.shop.api.domain.simple.ShopAppSimple;
import com.nbsaas.boot.shop.rest.convert.ShopAppSimpleConvert;
import com.nbsaas.boot.shop.rest.convert.ShopAppEntityConvert;
import com.nbsaas.boot.shop.rest.convert.ShopAppResponseConvert;
import com.nbsaas.boot.shop.data.repository.ShopAppRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   业务接口实现
*/
@Transactional
@Service
public class ShopAppResource extends BaseResource<ShopApp,ShopAppResponse, ShopAppSimple, ShopAppRequest>  implements ShopAppApi {

    @Resource
    private ShopAppRepository shopAppRepository;

    @Override
    public JpaRepositoryImplementation<ShopApp, Serializable> getJpaRepository() {
        return shopAppRepository;
    }

    @Override
    public Function<ShopApp, ShopAppSimple> getConvertSimple() {
        return new ShopAppSimpleConvert();
    }

    @Override
    public Function<ShopAppRequest, ShopApp> getConvertForm() {
        return new ShopAppEntityConvert();
    }

    @Override
    public Function<ShopApp, ShopAppResponse> getConvertResponse() {
        return new ShopAppResponseConvert();
    }




}


